import http from "../../utils/requestAI";
import type { addPrems } from "./employee_type";
import {type ExampleGenerate,type Data } from "./employee_type";



//列表
export const getemployee=(params?:Data)=>{

  return  http.get<ExampleGenerate>('/staff/list',params);

}

//删除
export const delemployee=(id:number)=>{

    console.log('删除1111',id);

    return  http.delete(`/staff/delete/${id}`);
  
}

export const delemployeeAll = (ids: number[]) => {
  console.log('批量删除执行', ids);
  return http.post(`/staff/deleteAll`,ids);
}
export const addemployee = (data: addPrems) => {
  return http.post(`/staff/add`, data);
}

export const authPublicKey = () => {
  return http.get('/auth/publicKey')
}

// // 定义公钥接口
// interface PublicKeyResponse {
//   code: number;
//   message: string;
//   data: {
//       publicKey: string;
//   };
// }

// // 修改 authPublicKey 方法的返回值类型
// export const authPublicKey = async (): Promise<PublicKeyResponse> => {
//   const response = await fetch('/auth/publicKey'); // 假设这是接口地址
//   return response.json();
// };
